#ifndef ALLINALL


#include<dlCluster/include/dlCluster.hpp>
#include<lcctoolbox_mess.hpp>
#include<lcctoolbox_block.hpp>

#ifdef _WIN32
#define __shakeShake_(AIAPtr) extern "C" __declspec(dllexport) void shakeShake(char* AIAPtr)
#else
#define __shakeShake_(AIAPtr) extern "C" __attribute__ ((visibility ("default"))) void shakeShake(char* AIAPtr)
#endif

namespace Allinall{


class allinall{
public:
	LccStuffCollector::dlCluster dls;
	LccToolbox::MESS mess;
	LccToolbox::Bstr programPath;
	LccToolbox::originstr temp;

	template<bool absPath=false,class T>
	bool loadDl( T&& note, const char* filename=nullptr){
		bool rst=false;
		if(absPath)
			rst=dls.add(CONST_LEFT_FORWARD(note),filename?filename:note.c_str());
		else
		{
#			ifdef _WIN32
			rst=dls.add(CONST_LEFT_FORWARD(note),filename?filename:note.c_str());
#			elif defined __GNUC__
			temp.combineStr(programPath.ptr(),"lib",filename?filename:note.c_str(),".so");
			rst=dls.add(CONST_LEFT_FORWARD(note),temp.c_str());
#			endif
		}
		if(rst)
		{	auto shake_p=reinterpret_cast<void(*)(char*)>(dls.getFunc(std::forward<T>(note),"shakeShake"));
			if(shake_p) shake_p(reinterpret_cast<char*>(this));
		}
		// printf("%s:%s[%s]\n",note.c_str(),rst?"succ":"fail",temp.c_str());
		return rst;
	}
};


}// namespace Allinall


#define ALLINALL
#endif